UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4CZjflZS0z8dWJqjAdtGeCettb/Jx5Z5BzkBppSwQYI='
WHERE
key_id = 'eef4791bf440e4c26b46a495297889a5c45ae831e457fdc7b78511dc33242f64'
AND (
token = '4CZjflZS0z8dWJqjAdtGeCettb/Jx5Z5BzkBppSwQYI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)