UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NnLvn9xLecFgsO/HU6b0iH8kIFqpVKTgXZ98xtqKdbk='
WHERE
key_id = '46b736c9d2c331ff2119cadb564064fbcfed27e07e2b2b44fa99787c06eba148'
AND (
token = 'NnLvn9xLecFgsO/HU6b0iH8kIFqpVKTgXZ98xtqKdbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)