UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Br02m8NLOu/mJBx+2amwCm2RpZmEXeqULKucm31LZSg='
WHERE
key_id = '0dbe12ecfb7c8c4877380c1d77c46aefae7d199c3c392dc60e1fcf6852615979'
AND (
token = 'Br02m8NLOu/mJBx+2amwCm2RpZmEXeqULKucm31LZSg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)