UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kaemyW4MFXbeeun87oA0+wcQCpHqOc/k0wTbc61rvW4=' 
WHERE 
  key_id = '9917ddd8d57e8e6888f26ca0a3b917623cea574129b86c4ee345d4a40d0c15f0' 
  AND (
    token = 'kaemyW4MFXbeeun87oA0+wcQCpHqOc/k0wTbc61rvW4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037