UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OpyAYFGwMUGaVmbLxRs9KNiHOtdWQhdZzMTHqVWXbyQ='
WHERE
key_id = '1b64ad1742bb013c2cc62159a505d84bc6d157cc887d3e0ea1c25f7c981a2e12'
AND (
token = 'OpyAYFGwMUGaVmbLxRs9KNiHOtdWQhdZzMTHqVWXbyQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)