UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UXhZpO+ef25iCRJQmnCDrsZm2fDTfwBg88d7Gl9uikY=' 
WHERE 
  key_id = '7d8e9c481180505577f69963f76775e2c96155f68889cf0f4ae7acdf601a186c' 
  AND (
    token = 'UXhZpO+ef25iCRJQmnCDrsZm2fDTfwBg88d7Gl9uikY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047