UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2uc/nB0GW1ceU1x8dwYnwcjydoz/lViCYdnOrn4BdP4=' 
WHERE 
  key_id = '1d65c1c31d975f47e7502f2c94dd3d248c8f3760e2aa38e114d86a97bf1b782b' 
  AND (
    token = '2uc/nB0GW1ceU1x8dwYnwcjydoz/lViCYdnOrn4BdP4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041