UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a8l6BML0i5hErsdTRw7aovYE9EH2uV+OVQ1zPMWCih8=' 
WHERE 
  key_id = '58cc1ce64a8a49216aab14783eb8221ef84e1647605d0e5447b0eb10eee1d7dd' 
  AND (
    token = 'a8l6BML0i5hErsdTRw7aovYE9EH2uV+OVQ1zPMWCih8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043