UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GNFtQk4PjhmFlgGpcUdk6h26rB0HtJ3NisQy1CEszo8='
WHERE
key_id = '9ace66f60025fafbfc26e15092e3e2384a5c84903b4cfc91c1526bc714914d55'
AND (
token = 'GNFtQk4PjhmFlgGpcUdk6h26rB0HtJ3NisQy1CEszo8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)