UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vz6PmtBe0dQtc+pPxL6jzDbaG6Rl4jEUXEp1nzpapbc=' 
WHERE 
  key_id = '88ab3eb25edc9eba588345965622a0197acb866c5194760843c0d340a26a270c' 
  AND (
    token = 'Vz6PmtBe0dQtc+pPxL6jzDbaG6Rl4jEUXEp1nzpapbc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028