UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5ULZg2Mnk+3AX5jfL6yH+UW2WO1pP0/ixpyilmz+bLw='
WHERE
key_id = '1ebb7016336b28a775ae81dcb7e873f8e8c138fbf131efb0a17b4820f592c2bd'
AND (
token = '5ULZg2Mnk+3AX5jfL6yH+UW2WO1pP0/ixpyilmz+bLw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)