UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cyNuwLoV3RvatFXjrjozlFhhhfVS2CoC12sqEkghlec=' 
WHERE 
  key_id = 'f7c802abddab727488a2a2406286adddf9569addbd9b8704f627d46b7f097228' 
  AND (
    token = 'cyNuwLoV3RvatFXjrjozlFhhhfVS2CoC12sqEkghlec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014