UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3npPlivoyxoSVWEVgXUqoNe1aLFNvBv9sdNLvSV2aC8='
WHERE
key_id = 'b5c44ad504d894ed3a00e13cb1fe39dfd71c892fe2faa603a1629515cf600f38'
AND (
token = '3npPlivoyxoSVWEVgXUqoNe1aLFNvBv9sdNLvSV2aC8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)