UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hLiX6p2FSCg+Q+EUXSt3o63ryiZNfIg+sNUR9Oazhsg='
WHERE
key_id = '25f27cf66e8803800c4c4ea276f0abd44ad6e8a5e49ac3cad1085acb193d649d'
AND (
token = 'hLiX6p2FSCg+Q+EUXSt3o63ryiZNfIg+sNUR9Oazhsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)