UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tQKXD1ZbnYcmEHHaMOdB+mDsSCmAIp4w9Mb56LXPDGY=' 
WHERE 
  key_id = 'e1e93400c4f383af4fb7e512106eaf30aea3e0a72947f4ae60a9193d15d602b0' 
  AND (
    token = 'tQKXD1ZbnYcmEHHaMOdB+mDsSCmAIp4w9Mb56LXPDGY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034