UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aeGVRZi20kM5VKTE8WKSwnEYC6/D85JUOfq7U/Bp9bE=' 
WHERE 
  key_id = '217ebaff46ac97fc70d02674cf441b2dc7d800cd4ad2bc5c7333937afe991a56' 
  AND (
    token = 'aeGVRZi20kM5VKTE8WKSwnEYC6/D85JUOfq7U/Bp9bE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053