UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5FDL13PiuvaL5wupINUJq3VLBWtzJ0MPgeixAYqoruI=' 
WHERE 
  key_id = 'fc05ffe4f842147b40b6f0779a6abd851dc655fa1ed33442214bb301f0e6341c' 
  AND (
    token = '5FDL13PiuvaL5wupINUJq3VLBWtzJ0MPgeixAYqoruI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045