UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xl4+VOXN0jQ5/iPqIsHFlySMOaPI1zWFel8BOVRfZ98=' 
WHERE 
  key_id = '22afaa1bae922970012f38752446e3fccb7352d624591f4466a8d944d4e956fb' 
  AND (
    token = 'xl4+VOXN0jQ5/iPqIsHFlySMOaPI1zWFel8BOVRfZ98=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017