UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qppwVjbNBnkgGsBXTBYq9GGtXqOSgrj2m23PvoKl1eE='
WHERE
key_id = 'a0f661c4cd672eb8d14acbe8cb4e0870ff59aa366fd385ae63c30657b2e16966'
AND (
token = 'qppwVjbNBnkgGsBXTBYq9GGtXqOSgrj2m23PvoKl1eE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)