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

Query time 0.00036