UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0vzaZeqOmiqhj7P12t+3/xgvu1VQDmsj/RudkqRP9po=' 
WHERE 
  key_id = '5932446ed5caedf20425d5359f13b2e229ed60a0706ccd64ab5584217bce3a20' 
  AND (
    token = '0vzaZeqOmiqhj7P12t+3/xgvu1VQDmsj/RudkqRP9po=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037