UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZHbYCXeZX5RJTvjDEraye9Dt4vtSK7+LiXJy/AyCAH8='
WHERE
key_id = '5de76748a6ac01cd6f4385652327b7ebe277162a3e26a9cdb08228d637a8972e'
AND (
token = 'ZHbYCXeZX5RJTvjDEraye9Dt4vtSK7+LiXJy/AyCAH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)