UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fbWY2Zu6Qu+Q8Co45uItH3c7vMlgp13HeJkRib9XiSo=' 
WHERE 
  key_id = 'dca36a423c2e94d91ed2f25385a9da6be724e5e3f6db3d31ae1b427d0cd8a54f' 
  AND (
    token = 'fbWY2Zu6Qu+Q8Co45uItH3c7vMlgp13HeJkRib9XiSo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037