UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5WL7AOGOm+Ulqll/dNoiZZIiYEJaWvxOV4IWuqB2iiI='
WHERE
key_id = 'bb13dfebfcaaf5b62284417e0892c3b81106b1d3ebd55cf5563d0cbcce27e4b1'
AND (
token = '5WL7AOGOm+Ulqll/dNoiZZIiYEJaWvxOV4IWuqB2iiI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)