UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xcUEqsypOuVcnkaWnTiWkmfkXJsIEF/O/It1lUrDJac='
WHERE
key_id = '22957279ce5e852c664c4733bf971d449fda79ce0ffc4a926cd318dc79fb911f'
AND (
token = 'xcUEqsypOuVcnkaWnTiWkmfkXJsIEF/O/It1lUrDJac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)