UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pvreBAYtlyHJEAqL4EME7UkWjKaBZxEOrXsSksLLiKw=' 
WHERE 
  key_id = '670d68b59d5b2251fe63753e9e538ababe34f8e766f4df494ddf54e54c9fc470' 
  AND (
    token = 'pvreBAYtlyHJEAqL4EME7UkWjKaBZxEOrXsSksLLiKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033