UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mFGSjC6xuXb+pjDZ9JF/STwTbfmnkajpI8zbl1Z3FnU='
WHERE
key_id = 'dd837c996bd70104cd4d4b47c878762b191096950f388461c58e38e0a7b545e7'
AND (
token = 'mFGSjC6xuXb+pjDZ9JF/STwTbfmnkajpI8zbl1Z3FnU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)