UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rkrNOci9Y/9K7HaGGWOi0TqhxKYxD4pioN4jmjXobec='
WHERE
key_id = '354349f58b91c3ec3a30119e92e8c8a95152cbcb41abe9ecdb1f7e080e3c6b6b'
AND (
token = 'rkrNOci9Y/9K7HaGGWOi0TqhxKYxD4pioN4jmjXobec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)