UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nkq0wlSCZJtitmyNtLfK8ssbcEzeFXRw9Sw9WshRqgo=' 
WHERE 
  key_id = '91815b4de5206fc052d2031c421a1338a269bbe16bfdcf513673ab951497c015' 
  AND (
    token = 'nkq0wlSCZJtitmyNtLfK8ssbcEzeFXRw9Sw9WshRqgo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018