UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bgpv5UxeSE/z6Yu0Vukgxa1ABUXk118hdy9mfsF+3Rc='
WHERE
key_id = '4264270a4aecf85c1ebbf5d389ab794cb09869f3436d2c7c55eef322534d317a'
AND (
token = 'Bgpv5UxeSE/z6Yu0Vukgxa1ABUXk118hdy9mfsF+3Rc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)