UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lb2qZrspqQ4AF7jwk75AApTdEO/pPJSP/ZK/xMVbRss=' 
WHERE 
  key_id = 'fd511427b59b9e0fa626bc538132a634624786bd3b4d34bf41e6729e3df117ea' 
  AND (
    token = 'Lb2qZrspqQ4AF7jwk75AApTdEO/pPJSP/ZK/xMVbRss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041