UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RQ9IkpIy3ZI/RqRZ8dk99PnUdAYhku+eGSVbrLIfOXQ='
WHERE
key_id = '37a5e8af2a9f26b5ba44e3c2c3968c367e4cea6dd4dedf1c2c38f5c7142af98e'
AND (
token = 'RQ9IkpIy3ZI/RqRZ8dk99PnUdAYhku+eGSVbrLIfOXQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)