UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0JC9F1aX+BCHdRadGuVnKlf4EwX8QuwZWTMao9E7MdY='
WHERE
key_id = '98b24fc38414cbd4cfaff18f3098ad07bc19a614cc98aaf85c3305001ed47902'
AND (
token = '0JC9F1aX+BCHdRadGuVnKlf4EwX8QuwZWTMao9E7MdY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)