UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LWAH9ik4S6iPp74JPOjpu+NwPROPmndbicLITBCG7u8=' 
WHERE 
  key_id = '2759ac2062b85789618335d1d85a03a1c6e7d6aba8d0d0ca7fb195a480b4e396' 
  AND (
    token = 'LWAH9ik4S6iPp74JPOjpu+NwPROPmndbicLITBCG7u8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039