UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4KKrQNhAUsbL67U+hJmW9rgl/4GH5v1k+A5F5hE6WJY='
WHERE
key_id = '645f1ef1adfac91cebd9d471dc0946e2dba0b5922309dfa96c5c3fa17fd99b95'
AND (
token = '4KKrQNhAUsbL67U+hJmW9rgl/4GH5v1k+A5F5hE6WJY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)