UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B+Hn0Iqe6S9NcIdSHnZVmoDmm32d4xMLpC/twoFHPj0=' 
WHERE 
  key_id = '9f597341a6dc25adb0003db5fc17c8210c6a52f79c0633f9677dcaf6b79858e2' 
  AND (
    token = 'B+Hn0Iqe6S9NcIdSHnZVmoDmm32d4xMLpC/twoFHPj0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039