UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xckN+PAI2nqMSQp6wra/oAyq5FC8YAvYITrh1/y8D0c=' 
WHERE 
  key_id = '98df7449a9ce6412c24d5bb8361a39606ee85d74f3d29d9f8184f7a8ff967d18' 
  AND (
    token = 'xckN+PAI2nqMSQp6wra/oAyq5FC8YAvYITrh1/y8D0c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046