UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xx8pP3R603VQ+E0yopKxbc058ciNlPh/6FBbqZvbPzE=' 
WHERE 
  key_id = '458bf62e7c25f33dac996c5f26832d67ea32330aeb6d3c08ffea29f1484c3d88' 
  AND (
    token = 'xx8pP3R603VQ+E0yopKxbc058ciNlPh/6FBbqZvbPzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036