UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'quwZrcL2vGH84RStaP2F8G6QfucbLeTQ3Gup2oqEqoM='
WHERE
key_id = '628ee1325902f7872da8d9a78188439c2460124f5c0ef7ad12a457580551c32f'
AND (
token = 'quwZrcL2vGH84RStaP2F8G6QfucbLeTQ3Gup2oqEqoM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)