UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GfBFfTuAdWKpHUqy8hpfGitQuSfHRQzzSR6KpL5ZOm4=' 
WHERE 
  key_id = '3616031daef322cb531e1a9c8b3e06f1544e30ef2ddafb60796fd4b2df621a39' 
  AND (
    token = 'GfBFfTuAdWKpHUqy8hpfGitQuSfHRQzzSR6KpL5ZOm4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044