UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W7xxC01pllQVPVSW0r0JyBugrWghHCRq/ZjpZzlLLfs=' 
WHERE 
  key_id = '817bcb0153954518f2989a2163bf0f22553a29d5721ce008d35eca018d401c17' 
  AND (
    token = 'W7xxC01pllQVPVSW0r0JyBugrWghHCRq/ZjpZzlLLfs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033