UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CYPOmSZbxM1s0bwWCnqw3V7srdfzTxU2cLbT9PbJNZU=' 
WHERE 
  key_id = '5706159b5b27875cf41ef627b30e0d3f97c55b14518740f9e5c13320ae853727' 
  AND (
    token = 'CYPOmSZbxM1s0bwWCnqw3V7srdfzTxU2cLbT9PbJNZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025