UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4M964J9RBUHwU+VIZyUtrRROJ7AigTZup70ZsFTIuzg='
WHERE
key_id = '830ed767f1fe2b1ae10622025d8794ae92f02280b14b15e5882f3512ed57c099'
AND (
token = '4M964J9RBUHwU+VIZyUtrRROJ7AigTZup70ZsFTIuzg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)