UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kJb2J27kLfF8GkL+fioCAUGxgft1aU9Y2E3EBAkAImM=' 
WHERE 
  key_id = '83ac155e21e20f521b09ae0500476cd6a3dd5d1430fa38fc65c01de5fa3a89e5' 
  AND (
    token = 'kJb2J27kLfF8GkL+fioCAUGxgft1aU9Y2E3EBAkAImM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032