UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C8IqB+LF4CUZhT97xueOgtATdvRdUu634hb69tlnx+g=' 
WHERE 
  key_id = '00804f902d9dec9ab0622ef550b4aa11ce75b06e6bfe1276793dee9d2f465cac' 
  AND (
    token = 'C8IqB+LF4CUZhT97xueOgtATdvRdUu634hb69tlnx+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019