UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u5+1A7oXu+ucM3pFLmXKzQb/nljKTeaTLtoZ2SYEexE=' 
WHERE 
  key_id = '849a8bda0bf93564390aeced58abc6a92aaf65df101f408b70ddcd991408b629' 
  AND (
    token = 'u5+1A7oXu+ucM3pFLmXKzQb/nljKTeaTLtoZ2SYEexE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020