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