UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0cAei0ZGdCk4im3BvpNKr0+6x9CBVnMhxLkGiZBqCR8=' 
WHERE 
  key_id = '08907f955738616b587ff72ad864ab8dd011276082cdc68df724348dac6e2209' 
  AND (
    token = '0cAei0ZGdCk4im3BvpNKr0+6x9CBVnMhxLkGiZBqCR8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043