UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZICFxCw3xIZGXovziH0tCFnnr/cHbxqsEWJh0eqw04c='
WHERE
key_id = 'c5929d0fac529d2eb4cf667747d3413ffb17c0368a37d3bf533569831390540f'
AND (
token = 'ZICFxCw3xIZGXovziH0tCFnnr/cHbxqsEWJh0eqw04c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)