UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ohlDISrMbEG1XkVtM7/vSfvxOAudmPKnntbIsMDl9g=' 
WHERE 
  key_id = '012af521fd0e7769a8be81de743f2b486e45e7ce06d46e04f429c16dc717931a' 
  AND (
    token = '9ohlDISrMbEG1XkVtM7/vSfvxOAudmPKnntbIsMDl9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030