UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3diJaJmHFrKKfsqA7Hzc4MWGjZnMtjXDSXCBD8/rpgo='
WHERE
key_id = '66ce3f0dfbd0dc8179db24eb7d23496e64aa87fc7090f25ebf4f85e73bf9889c'
AND (
token = '3diJaJmHFrKKfsqA7Hzc4MWGjZnMtjXDSXCBD8/rpgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)