UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vJ3X3kwZnJHH/LKLce6+FL72AU1Ff+9Qbg5aBKsPP6U=' 
WHERE 
  key_id = '5688dde6e427bef4ad2b568ab1d34eae607576a2442b288cac37b09aa0025bc7' 
  AND (
    token = 'vJ3X3kwZnJHH/LKLce6+FL72AU1Ff+9Qbg5aBKsPP6U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032