UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1f2yNzewXx+qRqHmYyLDdMFFyPuyPmAjRjHCtRhVdSY='
WHERE
key_id = '7fceac45325933183a5507f7595ac2734cc7535f58024e24b68670eba57fbb22'
AND (
token = '1f2yNzewXx+qRqHmYyLDdMFFyPuyPmAjRjHCtRhVdSY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)