UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '18pnH9vLGOOVO2Fef3xgGB+d3KnnBCDAhPwp5xV2tRo=' 
WHERE 
  key_id = '7542305cc2a13ca955a050ba3fb3abe71c09472edc19058a025214df7309e99b' 
  AND (
    token = '18pnH9vLGOOVO2Fef3xgGB+d3KnnBCDAhPwp5xV2tRo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056