UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7ksMhPr4qYrLDUdJxqpe1KE7zrgrP37iZ2OKVMI+/HM=' 
WHERE 
  key_id = '107682af3406694737d9addd6be710711a9eb8033287b598ed6dfb9782f3d622' 
  AND (
    token = '7ksMhPr4qYrLDUdJxqpe1KE7zrgrP37iZ2OKVMI+/HM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025