UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SVc+k1gn7vB9F1NpKA/yR+V37L5zygxbdl4SHcYEyj0='
WHERE
key_id = 'b1b44180971fef7908d1bdae78c88ed6fff15dc39cedebccdb522ccb9e39a79e'
AND (
token = 'SVc+k1gn7vB9F1NpKA/yR+V37L5zygxbdl4SHcYEyj0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)